import request from "@/utils/request";

// 新增
export async function addProductApi(data) {
  return request.post("/product/add", data);
}

// 编辑
export async function updateProductApi(data) {
  return request.post("/product/update", data);
}

// 删除
export async function deleteProductApi(data) {
  return request.post("/product/delete", data);
}

// 上传图片

export async function uploadFileApi(formData) {
  return request.post("/minio/upload", formData, {
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}

// 获取产品列表分页
export async function getProductListPageApi(data) {
  return request.post("/product/getProductListPage", data);
}

// 根据产品id获取产品信息
export async function getProductByIdApi(data) {
  return request.post("/product/getProductById", data);
}
